<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

<script type="text/javascript">
	var famatenexpensegrid;
	$(function() {
		famatenexpensegrid = $('#famatenexpensegrid')
				.datagrid(
						{
							//title : '商品列表',
							url : '${ctx}/autoinn/wxfacilitator/setting/maten/list',
							striped : true,
							rownumbers : true,
							pagination : true,
							singleSelect : true,
							idField : 'id',	
							pageSize : 50,
							pageList : [ 10, 20, 30, 40, 50, 100, 200, 300,
									400, 500 ],
							frozenColumns : [ [ {
								width : '80',
								title : '用户昵称',
								field : 'nickname'
								
							} ] ],
							columns : [ [
									{
										width : '150',
										title : '所属分类',
										field : 'pathname'
									},
									{
										width : '120',
										title : '电话号码',
										field : 'phonenum'
									},
									{
										width : '180',
										title : '服务门店',
										field : 'name'
									},
									{
										width : '220',
										title : '描述',
										field : 'des'
									},
									{
										width : '120',
										title : '消费时间',
										field : 'createtime'
									},
									{
										width : '80',
										title : '状态',
										field : 'state',
										formatter : function(value, row, index) {
											switch (value) {
											case 0:
												return '未消费';
											case 1:
												return '已消费';
											case 2:
												return '未完成';
											}
										}
									},
									{
										width : '120',
										title : '操作',
										field : 'action',
										formatter : function(value, row) {
											var str = "";
											str += sy
											.formatString(
													'<span onclick="famatenexpenseupdateFun(\'{0}\');" style="margin-left:3px;cursor:pointer;">【{1}】</span>',
													row.id, "详情");
										
											return str;
										}
									} ] ],
							toolbar : '#famatenexpensetoolbar',
							onBeforeLoad : function(param) {
								parent.$.messager.progress({
									text : '数据加载中....'
								});
							},
							onLoadSuccess : function(data) {
								parent.$.messager.progress('close');
							}
							
							
						});
	});

	


	//修改
	var famatenexpenseupdateFun = function(id) {
		$('<div/>')
				.dialog(
						{
							href : '${ctx}/maintenance/expense/detail?id=' + id+'&s=1',
							width : 740,
							height : 380,
							modal : true,
							title : '订单详情',
							buttons : [ {
								text : '关闭',
								iconCls : 'icon-add',
								handler : function() {
									var d = $(this).closest('.window-body');
								
     								d.dialog('destroy');
													

								}

							} ],
							onLoad : function() {
								//$("#res_updateForm").form('load',entity);
							
							},
							onClose : function() {
								$(this).dialog('destroy');
							}
						});

	};
</script>
<!-- 界面布局  -->
<div class="easyui-layout" style="width: 100%; height: 100%;"
	data-options="fit:true,border:false">

	<div id="famatenexpensetoolbar" style="display: none;">

		<table>
			<tr>
				<td>
					<form id="famatenexpensesearchForm">
						<table>
							<tr style="font-size: 13px;">
								<td>客户电话</td>
								<td><input name="phonenum" style="width: 150px;" /></td>
								<td>服务门店</td>
								<td><input  name="storename"  style="width: 155px;" /></td>
							
								<td>消费时间</td>
								<td><input name="exstartime" class="Wdate"
									onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
									readonly="readonly" style="width: 120px;" />-<input
									name="exendtime" class="Wdate"
									onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
									readonly="readonly" style="width: 120px;" /></td>
								<td><a href="javascript:void(0);" class="easyui-linkbutton"
									data-options="iconCls:'icon-search',plain:true"
									onclick="matenexpensegrid.datagrid('load',sy.serializeObject($('#famatenexpensesearchForm')));">过滤</a><a
									href="javascript:void(0);" class="easyui-linkbutton"
									data-options="iconCls:'icon-reload',plain:true"
									onclick="$('#famatenexpensesearchForm input').val('');famatenexpensegrid.datagrid('load',{});">重置过滤</a></td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		
		</table>
	</div>
	<div data-options="region:'center',title:'保养订单管理'" style="padding: 2px;">
		<div class="easyui-layout" data-options="fit : true,border : false">
			<div data-options="region:'center',border:false">
				<table id="famatenexpensegrid" data-options="fit:true,border:false"></table>
			</div>
		</div>
	</div>
	
</div>